<?php 

class UserController extends Controller{
	private $model;
	public function __init(){
		parent::__init();
		$this->model = K('User');
	}
	public function index(){
		if(!$data = $this->model->user()){
			$this->error($this->model->error);
		}
		$this->assign('data',$data);
		$this->display();
	}
	public function admin(){
		if(!$data = $this->model->admin()){
			$this->error($this->model->error);
		}
		$this->assign('data',$data);
		$this->display();
	}
	public function lock(){
		$uid = Q('get.uid',0,'intval');
	    if(!$data = $this->model->lock($uid)){
			$this->error($this->model->error);
		}
		go(U('index'));
	}
	public function nolock(){
		$uid = Q('get.uid',0,'intval');
	     if(!$data = $this->model->nolock($uid)){
			$this->error($this->model->error);
		}
		go(U('index'));
	}
}
